Fix subscription required modal on new org creation #1464
Closed
+138
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Summary
New organizations show "subscription required" immediately after creation because
stripe_infocreation is async (10-60s queue delay) while org creation is synchronous. Frontend fetchesget_orgs_v7()beforestripe_infoexists, resulting intrial_left=0.Solution: Poll for
stripe_infocreation every 3s (max 2min) when detecting new orgs (trial_left=0 && !paying && app_count=0). Show "Setting up your account" overlay instead of payment error.Implementation
Organization store (
src/stores/organization.ts):isWaitingForStripeInfo()heuristic usingapp_count=0to distinguish new orgs from payment failurespollForStripeInfo()with localStorage persistence, timeout guards, error handlingPOLL_INTERVAL_MS=3000,POLL_TIMEOUT_MS=120000Dashboard (
src/pages/dashboard.vue):isNewOrganizationLoading=trueBanner (
src/components/Banner.vue):Translations (
messages/en.json):setting-up-account,initializing-trial,this-takes-few-secondsTest plan
Screenshots
N/A - Requires live database trigger queue to reproduce
Checklist
bun run lint:backend && bun run lint.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
npm.jsr.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)/update-job-proxy /update-job-proxy(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.